﻿using Hotel_Project.BIZ;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Hotel_Project.HotelForm
{
    public partial class Updata_Vip_jjh : Form
    {
        Vip_Form_Jjh action = new Vip_Form_Jjh();
        Vip_Maintenance_Jjh form = new Vip_Maintenance_Jjh();
        int Id = 0;
        public Updata_Vip_jjh(int index,Vip_Maintenance_Jjh mai)
        {
            InitializeComponent();
            comboBox1.SelectedIndex = 0;
            comboBox3.SelectedIndex = 0;
            comboBox4.SelectedIndex = 0;
            comboBox7.SelectedIndex = 0;
            Id = index;
            this.form = mai;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            action.Vip_Form_AddButtom(textBox1.Text, textBox2.Text, comboBox1.SelectedItem.ToString(), dateTimePicker1.Text
               , textBox3.Text, textBox4.Text, comboBox3.SelectedItem.ToString(), comboBox4.SelectedItem.ToString()
               , dateTimePicker2.Text, dateTimePicker3.Text, comboBox7.SelectedItem.ToString(), textBox5.Text, textBox6.Text
               , textBox7.Text, textBox8.Text, textBox9.Text, textBox10.Text, textBox11.Text);
            new Vip_Maintenance_Jjh_BIZ().Initialize(form.VIP_DataGrid);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            action.Vip_Form_DelButtom(Convert.ToInt32(textBox1.Text));
            new Vip_Maintenance_Jjh_BIZ().Initialize(form.VIP_DataGrid);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            action.Vip_Form_SaveButtom(textBox1.Text, textBox2.Text, comboBox1.SelectedItem.ToString(), dateTimePicker1.Text
               , textBox3.Text, textBox4.Text, comboBox3.SelectedItem.ToString(), comboBox4.SelectedItem.ToString()
               , dateTimePicker2.Text, dateTimePicker3.Text, comboBox7.SelectedItem.ToString(), textBox5.Text, textBox6.Text
               , textBox7.Text, textBox8.Text, textBox9.Text, textBox10.Text, textBox11.Text);
            new Vip_Maintenance_Jjh_BIZ().Initialize(form.VIP_DataGrid);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            new Vip_Maintenance_Jjh_BIZ().Initialize(form.VIP_DataGrid);
        }
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Updata_Vip_jjh_Load(object sender, EventArgs e)
        {
            new Vip_Form_Jjh().Vip_Form_Locad(Id,this);
        }

        private void Updata_Vip_jjh_FormClosing(object sender, FormClosingEventArgs e)
        {
            new Vip_Maintenance_Jjh_BIZ().Initialize(form.VIP_DataGrid);
        }
    }
}
